package org.geektimes.projects.user.web.listener;

import org.geektimes.context.ComponentContext;
import org.geektimes.projects.user.sql.DBConnectionManager;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.util.logging.Logger;

/**
 * 测试用途
 */
@Deprecated
public class TestingListener implements ServletContextListener {

    private Logger logger = Logger.getLogger(this.getClass().getName());

    @Override
    public void contextInitialized(ServletContextEvent sce) {

        ComponentContext componentContext = new ComponentContext();
        componentContext.init(sce.getServletContext());
        DBConnectionManager dbConnectionManager = componentContext.lookupComponent("bean/DBConnectionManager");
        dbConnectionManager.getConnection();

    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }

}
